package com.zs.demo111.web;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController//消息生产方
public class MQProduceAction {
    @Resource
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("simpleMessage")
    public String simpleMessage(String data){
        String queue="simpleQueue";
        rabbitTemplate.convertAndSend(queue,data);
        return "简单消息发送"+data;

    }
}
